home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / vol15n11.zip / TBWIZ.ZIP / TBMENUIT.CLS < prev    next >
Text File  |  1996-02-21  |  2KB  |  58 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4. END
  5. Attribute VB_Name = "tbMenuItem"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = False
  8. Option Explicit
  9.  
  10. Public VBInstance As Object
  11. Public Operation As Integer
  12.  
  13. Public Sub AfterClick()
  14. '___process menu line click events
  15. Dim i%, j%
  16. Dim MyProperty As Object
  17. Dim testControl As Object
  18. '___make sure form doesn't have unsaved changes
  19. 'If Not CheckForDirt() Then
  20.     Select Case Operation
  21.     Case opLoad
  22.         Load tbLoadForm
  23.     Case opSave
  24.         Load tbSaveForm
  25.     End Select
  26. 'End If
  27. End Sub
  28.  
  29. Public Function CheckForDirt() As Boolean
  30. '___warn user if form need to be saved
  31. Dim CurrFormName$, i%
  32. With gobjIDEAppInst.ActiveProject
  33.     CurrFormName$ = .ActiveForm.Properties.Item("Name")
  34.     With .Components
  35.         For i% = 0 To .Count - 1
  36.             If .Item(i%).Name = CurrFormName$ Then
  37.                 If .Item(i%).IsDirty Then
  38.                                         
  39.                     CheckForDirt = True
  40.                     Beep
  41. '                    Alert "Please save " & CurrFormName$ & " before attempting to load or save a toolbar."
  42. '                    Load SavePrmpt
  43.                     SavePrmpt.Label1.Caption = "Please save " & CurrFormName$ & " before attempting to load or save a toolbar."
  44.                     SavePrompt.Show 1
  45.                   Exit Function
  46.                 End If
  47.             End If
  48.         Next
  49.     End With
  50. End With
  51. End Function
  52.  
  53. Private Sub Class_Initialize()
  54.  
  55. End Sub
  56.  
  57.  
  58.